﻿#include "media_source/cam_source.h"

namespace xrtc {

rtc::scoped_refptr<CamSource> CamSource::Create(
    rtc::VideoSourceInterface<webrtc::VideoFrame>* vcm_capturer) 
{
    return new rtc::RefCountedObject<CamSource>(vcm_capturer);
}

CamSource::CamSource(
    rtc::VideoSourceInterface<webrtc::VideoFrame>* vcm_capturer) :
    webrtc::VideoTrackSource(false),
    vcm_capturer_(vcm_capturer)
{
}

rtc::VideoSourceInterface<webrtc::VideoFrame>* CamSource::source() {
    return vcm_capturer_;
}

} // namespace xrtc